<template>
  <div>
    <div class="tab">
      <div class="back" @click="handleBack">返回</div>
      <div class="title">电影详情</div>
    </div>
    <img :src="list.pic" class="movieImg" />
    <div class="header">
      <p>{{ list.title }}</p>
      <p>{{ list.slogo }}</p>
      <p>
        <span>{{ list.evaluate }}</span> 条评论
      </p>
      <div
        class="bg"
        :style="{
          backgroundImage: 'url(' + list.pic + ')',
          filter: 'blur(15px)',
          backgroundRepeat: 'no-repeat',
          backgroundSize: '100% 100%',
        }"
      ></div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
    };
  },
  methods: {
    handleBack() {
      this.$router.back();
    },
  },
  mounted() {
    var { id } = this.$route.query;
    this.$http(`http://47.108.197.28:4000/api/movieDetail?id=${id}`).then(
      (res) => {
        this.list = res.data.res[0];
      }
    );
  },
};
</script>

<style scoped>
.tab {
  position: relative;
  text-align: center;
  line-height: 80px;
  height: 80px;
  background-color: rgb(83, 120, 134);
  color: #fff;
}
.back {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}
.tab .title {
  font-size: 34px;
}
.bg {
  position: absolute;
  height: 400px;
  width: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}
.header {
  height: 400px;
  box-sizing: border-box;
  padding: 50px 40px;
  position: relative;
  color: #fff;
  overflow: hidden;
  letter-spacing: 5px;
}
.header > p:nth-child(1) {
  font-size: 40px;
}
.header > p:nth-child(2) {
  font-size: 28px;
  margin: 50px 0;
}
.header > p:nth-child(3) span {
  letter-spacing: 0;
  color: red;
}
.movieImg {
  position: absolute;
  right: 30px;
  top: 300px;
}
</style>